#!/bin/bash
echo "删除.git"
rm -rf .git
newpath=$1
echo "参数如果有特殊字符需要转义"
echo $newpath
echo "替换项目引用"
grep -rl "gitee.com/liuyongchina/init-project" . --exclude=*sh| xargs sed -i "" "s/gitee\.com\/liuyongchina\/init-project/${newpath}/g"
echo "初始化项目"
go mod init ${newpath//\\/""}
echo "add module"
go mod tidy